package com.faithbj.printer;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

import com.faithbj.printer.service.RemoteInteractive;
import com.faithbj.printer.service.Impl.RemoteInteractiveImpl;

public class InsuranceConfirm {
	private RemoteInteractive ri;
	private CloseableHttpClient  httpClient;
	
	public InsuranceConfirm(){
		this.ri = new RemoteInteractiveImpl();
		this.httpClient = HttpClients.createDefault();
	}
	
	public void close(){
		try {
			this.httpClient.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public String insuranceQuery(String poaCode) throws ClientProtocolException, IOException{
		String url = "http://localhost/prpall/commonship/sff/UIPreConfirmQueryList.jsp?PoaCode="+poaCode;
		return this.ri.getResource(url, this.httpClient);
	}

}
